package cn.com.basic.framework.aliyun.odps.error;

import cn.com.basic.framework.exception.enums.IErrorCode;

/**
 * @author mj1996
 */

public enum OdpsError implements IErrorCode {

    GET_PROJECT_ERROR("90001", "获取ODPS工作空间异常"),
    EXECUTE_SQL_ERROR("90002", "执行SQL任务异常"),
    MANAGER_IS_NULL("90003", "管理器错误"),
    TUNNEL_ERROR("90004", "批量操作错误"),
    PARTITION_ERROR("90005", "分区错误"),
    READ_DATA_ERROR("90006", "读取数据异常"),
    RUN_SQL_ODPS_EXCEPTION("90007", "执行SQL出现ODPS异常"),
    RUN_SQL_FAILED("90008", "执行SQL异常"),
    TABLE_TRUNCATE_ERROR("90009", "执行Truncate异常"),
    ODPS_WRITER_ERROR("90010", "上传ODPS记录异常");


    private String code;
    private String description;

    OdpsError(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getKey() {
        return this.code;
    }

    @Override
    public String getValue() {
        return this.description;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Describe:[%s]", this.code, this.description);
    }

}